package insight.miescor.opp.domain;

import insight.miescor.annotations.Code;
import insight.miescor.annotations.Constants;
import insight.miescor.annotations.Notebook;
import insight.miescor.annotations.UDF;
import insight.web.delegates.PrimaveraDelegate;

import com.primavera.ServerException;
import com.primavera.integration.client.Session;
import com.primavera.integration.client.bo.BusinessObjectException;
import com.primavera.integration.client.bo.object.Project;
import com.primavera.integration.network.NetworkException;

public class Review {
	// region Common fields
	private String opportunityId;
	private int prjObjId;
	private String userId;
	private int assignmentId;

	@Notebook(topicName = Constants.ProjectFields.ADD_NOTES, append = true)
	private String addNotes;
	
	@Code(name = Constants.ProjectFields.RISK_RATING)
	private CodeValue riskRating;
	// endregion

	// region Capability Review fields
	@Notebook(topicName = Constants.ProjectFields.CAPABILITY_ASS)
	private String capabilityAssesment;
	
	@Code(name = Constants.ProjectFields.BANDWIDTH)
	private CodeValue bandwidth;
	
	@Code(name = Constants.ProjectFields.CAPABILITY)
	private CodeValue capability;
	// endregion

	// region Financial Review fields
	@UDF(name = Constants.ProjectFields.CONTRACT_VALUE_EX_TAXES, dataType = Constants.UDFDataType.COST)
	private double contractValue;
	@Notebook(topicName = Constants.ProjectFields.REALIZATION)
	private String realization;
	@Notebook(topicName = Constants.ProjectFields.FIN_RISK_ASSESMENT)
	private String finRiskAssessment;
	@Notebook(topicName = Constants.ProjectFields.FIN_VIABILITY)
	private String finViability;
	@Notebook(topicName = Constants.ProjectFields.FUNDING_DETAILS)
	private String fundingDetail;

	@Code(name = Constants.ProjectFields.CONTRACT_VALUE_RATING)
	private CodeValue contractValueRating;
	@Code(name = Constants.ProjectFields.FIN_VIABILITY_RATING)
	private CodeValue finViabilityRating;
	@Code(name = Constants.ProjectFields.REALIZATION_RATING)
	private CodeValue realizationRating;
	@Code(name = Constants.ProjectFields.PROJECT_FUNDING)
	private CodeValue projectFunding;
	// endregion Financial Review fields

	// region Legal Review fields
	@Notebook(topicName = Constants.ProjectFields.FAV_TERMS)
	private String favourableTerms;
	@Notebook(topicName = Constants.ProjectFields.ADV_TERMS)
	private String adverseTerms;
	@Notebook(topicName = Constants.ProjectFields.REG_RATING)
	private String regulatoryRequirement;
	@Code(name = Constants.ProjectFields.REG_RATING)
	private CodeValue regulatoryRating;
	// endregion Legal Review fields

	// region Strategic Review fields
	@Notebook(topicName = Constants.ProjectFields.STRATEGIC_IMP)
	private String strategicImportance;
	
	@Notebook(topicName = Constants.ProjectFields.CUSTOMER)
	private String customerConsultant;
	@Notebook(topicName = Constants.ProjectFields.ALIGNMENT)
	private String alignment;

	@Code(name = Constants.ProjectFields.LOCATION_RATING)
	private CodeValue locationRating;
	@Code(name = Constants.ProjectFields.BUILD_TRACK)
	private CodeValue buildTrack;
	@Code(name = Constants.ProjectFields.MARKET_PENETRATION)
	private CodeValue marketPenetration;
	@Code(name = Constants.ProjectFields.IS_COMPULSIVE_WIN)
	private CodeValue isCompulsiveWin;
	@Code(name = Constants.ProjectFields.WIN_RATIO)
	private CodeValue winRatio;
	@Code(name = Constants.ProjectFields.TYPE_OF_WORK)
	private CodeValue workType;
	@Code(name = Constants.ProjectFields.CUSTOMER_RATING)
	private CodeValue customerRating;
	@Code(name = Constants.ProjectFields.CONSULTANT_RATING)
	private CodeValue consultantRating;
	@Code(name = Constants.ProjectFields.WINNABILITY)
	private CodeValue Winnability;

	// endregion Strategic Review fields

	public Review(Session session, Project project)
			throws BusinessObjectException, ServerException, NetworkException {
		if (project != null) {
			this.setPrjObjId(project.getObjectId().toInteger());
			this.setOpportunityId(project.getId());
			PrimaveraDelegate.getDataFromP6(session, project, this);
		}
	}

	

	// region common fields getter/setter
	public String getOpportunityId() {
		return opportunityId;
	}

	public void setOpportunityId(String opportunityId) {
		this.opportunityId = opportunityId;
	}

	public int getPrjObjId() {
		return prjObjId;
	}

	public void setPrjObjId(int prjObjId) {
		this.prjObjId = prjObjId;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public int getAssignmentId() {
		return assignmentId;
	}

	public void setAssignmentId(int assignmentId) {
		this.assignmentId = assignmentId;
	}

	public String getAddNotes() {
		return addNotes;
	}

	public void setAddNotes(String addNotes) {
		this.addNotes = addNotes;
	}

	public CodeValue getRiskRating() {
		return riskRating;
	}

	public void setRiskRating(CodeValue riskRating) {
		this.riskRating = riskRating;
	}

	// endregion common fields properties

	// region Capability Review getter/setter
	public String getCapabilityAssesment() {
		return capabilityAssesment;
	}

	public void setCapabilityAssesment(String capabilityAssesment) {
		this.capabilityAssesment = capabilityAssesment;
	}

	public CodeValue getBandwidth() {
		return bandwidth;
	}

	public void setBandwidth(CodeValue bandwidth) {
		this.bandwidth = bandwidth;
	}

	public CodeValue getCapability() {
		return capability;
	}

	public void setCapability(CodeValue capability) {
		this.capability = capability;
	}

	// endregion Capability Review properties

	// region Financial Review getter/setter
	public double getContractValue() {
		return contractValue;
	}

	public void setContractValue(double contractValue) {
		this.contractValue = contractValue;
	}

	public String getRealization() {
		return realization;
	}

	public void setRealization(String realization) {
		this.realization = realization;
	}

	public String getFinRiskAssessment() {
		return finRiskAssessment;
	}

	public void setFinRiskAssessment(String finRiskAssessment) {
		this.finRiskAssessment = finRiskAssessment;
	}

	public String getFinViability() {
		return finViability;
	}

	public void setFinViability(String finViability) {
		this.finViability = finViability;
	}

	public String getFundingDetail() {
		return fundingDetail;
	}

	public void setFundingDetail(String fundingDetail) {
		this.fundingDetail = fundingDetail;
	}

	public CodeValue getContractValueRating() {
		return contractValueRating;
	}

	public void setContractValueRating(CodeValue contractValueRating) {
		this.contractValueRating = contractValueRating;
	}

	public CodeValue getFinViabilityRating() {
		return finViabilityRating;
	}

	public void setFinViabilityRating(CodeValue finViabilityRating) {
		this.finViabilityRating = finViabilityRating;
	}

	public CodeValue getRealizationRating() {
		return realizationRating;
	}

	public void setRealizationRating(CodeValue realizationRating) {
		this.realizationRating = realizationRating;
	}

	public CodeValue getProjectFunding() {
		return projectFunding;
	}

	public void setProjectFunding(CodeValue projectFunding) {
		this.projectFunding = projectFunding;
	}

	// endregion Financial Review Properties

	// region Legal Review getter/setter

	public String getFavourableTerms() {
		return favourableTerms;
	}

	public void setFavourableTerms(String favourableTerms) {
		this.favourableTerms = favourableTerms;
	}

	public String getAdverseTerms() {
		return adverseTerms;
	}

	public void setAdverseTerms(String adverseTerms) {
		this.adverseTerms = adverseTerms;
	}

	public String getRegulatoryRequirement() {
		return regulatoryRequirement;
	}

	public void setRegulatoryRequirement(String regulatoryRequirement) {
		this.regulatoryRequirement = regulatoryRequirement;
	}

	public CodeValue getRegulatoryRating() {
		return regulatoryRating;
	}

	public void setRegulatoryRating(CodeValue regulatoryRating) {
		this.regulatoryRating = regulatoryRating;
	}

	// endregion Legal Review Properties

	// region Strategic Review getter/setter
	public String getStrategicImportance() {
		return strategicImportance;
	}

	public void setStrategicImportance(String strategicImportance) {
		this.strategicImportance = strategicImportance;
	}

	public String getCustomerConsultant() {
		return customerConsultant;
	}

	public void setCustomerConsultant(String customerConsultant) {
		this.customerConsultant = customerConsultant;
	}

	public String getAlignment() {
		return alignment;
	}

	public void setAlignment(String alignment) {
		this.alignment = alignment;
	}

	public CodeValue getLocationRating() {
		return locationRating;
	}

	public void setLocationRating(CodeValue locationRating) {
		this.locationRating = locationRating;
	}

	public CodeValue getBuildTrack() {
		return buildTrack;
	}

	public void setBuildTrack(CodeValue buildTrack) {
		this.buildTrack = buildTrack;
	}

	public CodeValue getMarketPenetration() {
		return marketPenetration;
	}

	public void setMarketPenetration(CodeValue marketPenetration) {
		this.marketPenetration = marketPenetration;
	}

	public CodeValue getIsCompulsiveWin() {
		return isCompulsiveWin;
	}

	public void setIsCompulsiveWin(CodeValue isCompulsiveWin) {
		this.isCompulsiveWin = isCompulsiveWin;
	}

	public CodeValue getWinRatio() {
		return winRatio;
	}

	public void setWinRatio(CodeValue winRatio) {
		this.winRatio = winRatio;
	}

	public CodeValue getWorkType() {
		return workType;
	}

	public void setWorkType(CodeValue workType) {
		this.workType = workType;
	}

	public CodeValue getCustomerRating() {
		return customerRating;
	}

	public void setCustomerRating(CodeValue customerRating) {
		this.customerRating = customerRating;
	}

	public CodeValue getConsultantRating() {
		return consultantRating;
	}

	public void setConsultantRating(CodeValue consultantRating) {
		this.consultantRating = consultantRating;
	}

	public CodeValue getWinnability() {
		return Winnability;
	}

	public void setWinnability(CodeValue winnability) {
		Winnability = winnability;
	}
	// endregion Strategic Review Properties

}
